import Mock from 'mockjs'

// 生成数据列表
var dataList = []
//待处理收文待办数量和分页获取数据
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
  dataList.push(Mock.mock({
    // 'userId': '@increment',
    // 'username': '@name',
    // 'email': '@email',
    // 'mobile': /^1[0-9]{10}$/,
    // 'status': 1,
    // 'roleIdList': null,
    // 'createUserId': 1,
    // 'createTime': 'datetime',
	
	"title": '@cparagraph(1, 3)', //标题
	"bizId": '@increment', 
	"bizTypeCode": '@increment', 
	"bizType|1": [0,1,2,3],             //公文类型
	"detailType": null, 
	"configId": null, 
	"code": '@increment', 
	"name": '@name', 
	"resourceId": null, 
	"transactor": null, 
	"completeTime": '@date', 
	"createTime": '@date', 
	"proInstId": "cb3ae01a16eb4321b15759d5ed0b84b8", //主键
	"itemType|1": [0,1,2,3], 
	"status|1": [0,1], 
	"actInstId": null, 
	"actDefId": null, 
	"workitemId": null, 
	"proDirId": null, 
	"mainToUserIds": null, 
	"directDeptIds": null, 
	"copyTo": null, 
	"gwType": null, 
	"gwStatus": null,                //签批状态
	"emergencyLevel": null, 
	"state": "0"

  }))
}

//待处理收文待办数量和分页获取数据
var getSwList = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
  getSwList.push(Mock.mock({
	"FILE_SIZE": '@increment',            //来文号 
	"SW_REMARKS": null, 
	"DEPT_NAME": "华北管理局", 
	"SW_WORD_ID": null, 
	"SW_YEAR": null, 
	"PHONE": null, 
	"SW_TYPE": null, 
	"CLASSIFICATIONNAME": "无",    //密级
	"AGENT": null, 
	"FORWARD_TYPE": null, 
	"URGENCYNAME": "平件",      //缓急
	"ACCEPT_BIZ_ID": null, 
	"SW_NUM": null, 
	"ACCEPT_DEPT": "ffc0c86d4893433392b6c867fc631bf0", 
	"REISSUE_STATUS": null, 
	"CREATE_TIME": "2021-07-09T06:48:36.258+0000",   //发送时间
	"UUID": "fa46fe1619554635a4c7cf595baf0642", 
	"SW_CODE": null, 
	"ACCEPT_TYPE": null, 
	"TELEGRAM_TYPE": null, 
	"SEND_TYPE": "mainTo", 
	"FW_REMARK": "", 
	"BIZ_ID": "c96f2b3d48900001d4a61530711015a8", 
	"ACCEPT_TIME": null, 
	"USER_NAME": null, 
	"BIZ_TYPE": "fw", 
	"TELEGRAM_TIME": null, 
	"ACCEPT_ID": null, 
	"RESEND_STATUS": null, 
	"SEND_DEPT": "0a5fe09a8e1d47dcb76b00197ed08069", 
	"TITLE": '@cparagraph(1, 3)',               //标题
	"SW_WORD": null, 
	"CREATE_ID": "870d9bbdc50a4844bcdd7387ff799ecb", 
	"REGISTER_TYPE": null


  }))
}

//获取待核收文待办数量
var gwhgList = []
for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
  gwhgList.push(Mock.mock({
	"rowNum": '@increment', 
	"errorMsg": null, 
	"fwId": "499062105d744f048dd32b43756e8e14", 
	"fwBizType": "glj_fw", 
	"title": "huiqian44444", 
	"drafterDeptName": null, 
	"drafterName": null, 
	"draftTime": "2021-07-06", 
	"statusName": null, 
	"fwTypeName": null, 
	"fwBizTypeName": "发文", 
	"fwNum": null, 
	"proInstId": "4c018985528840fba6cace7577fa7380", 
	"curActName": "核稿中", 
	"fwType": null, 
	"fwWordId": "", 
	"fwWord": null, 
	"fwYear": null, 
	"secrecyLevel": null, 
	"emergencyLevel": "1", 
	"fwCode": null, 
	"drafterId": "1f09bd6061904d6eadf143f060f41b45", 
	"drafterDeptId": "ffc0c86d4893433392b6c867fc631bf0", 
	"delFlag": "2", 
	"draftStatus": "2", 
	"status": "2", 
	"createTime": null, 
	"fwNumType": null, 
	"subject": null, 
	"gwhgStatus": "1", 
	"state": null, 
	"resourceId": null, 
	"hgTime": null, 
	"jinjizhongyao": "0", 
	"withdrawYhgw": null, 
	"flag": null

  }))
}

/**
 * 1.获取待办汇总接口-根据当前用户获取紧急重要 限时办文 待审签 待阅办 总数量 分页获取待办列表也是这个接口
 * todoTab 必传 类型 0紧急重要  1限时办文  2待审签   3待阅办
 * page 必传 当前页
 * rows必传 每页条数
 * 调用示例：http://192.168.240.130:8088/ca ac/oa/mywork/MytodoWorks?todoTab=0&page=1&rows=10
 */
export function mytodoWorks () {
  return {
    // isOpen: false,
    url: '/caac/oa/mywork/MytodoWorks',
    type: 'get',
    data: {
      'code': 200,
	  'message': null,
	  'data':{
		  'total':dataList.length,
		  'rows':dataList
	  }
      
    }
  }
}

// 待处理收文待办数量和分页获取数据
export function getSwListData () {
  return {
    // isOpen: false,
    url: '/caac/oa/doc/fwend/getSwListData',
    type: 'get',
    data: {
      'code': 200,
      'message': null,
      'data':{
		  'total':getSwList.length,
		  'rows':getSwList
		}
    }
  }
}

// 获取待核收文待办数量
export function queryGwhgList () {
  return {
    // isOpen: false,
    url: '/caac/oa/doc/gljgwhgList/queryGwhgList',
    type: 'get',
    data: {
      'code': 200,
      'message': null,
      'data':{
      		  'total':gwhgList.length,
      		  'rows':gwhgList
      		}
    }
  }
}

// 添加用户
export function add () {
  return {
    // isOpen: false,
    url: '/sys/user/save',
    type: 'post',
    data: {
      'msg': 'success',
      'code': 0
    }
  }
}

// 修改用户
export function update () {
  return {
    // isOpen: false,
    url: '/sys/user/update',
    type: 'post',
    data: {
      'msg': 'success',
      'code': 0
    }
  }
}

// 删除用户
export function del () {
  return {
    // isOpen: false,
    url: '/sys/user/delete',
    type: 'post',
    data: {
      'msg': 'success',
      'code': 0
    }
  }
}
